import { useRouteError, Link } from 'react-router-dom';

const ErrorPage = () => {
  const error = useRouteError();

  return (
    <div style={{ padding: '2rem' }}>
      <h1>发生错误</h1>
      <p>抱歉，加载过程中出现问题</p>
      {error?.message && <p>错误信息：{error.message}</p>}
      <Link to="/">返回首页</Link>
    </div>
  );
};

export default ErrorPage;